<?php

class FormExample extends MForm implements IMForm {
    
    protected $id = array('primary_key' => true);
    protected $name = array('label'=>'Name',
                            'blank'=>false,
                            'xtra'=>'class="TextDesc"');
    
    protected $first_name = array('label'=>'FirstName',
                            'blank'=>false);
    
    protected function clean_name(){
        if ( strlen($this->cleaned_data['last_name']) < 2){
            $this->raiseValidationError('Please longeer.');
        }
    }
    protected function clean_first_name(){
        if ( strlen($this->cleaned_data['first_name']) < 2){
            $this->raiseValidationError('Please longer.');
        }
    }
    
    /**
     * Optional...
     */
    /*function __construct($data=null){
        # Inits here before the super call
        #$personManager = get_manager('person');
        #$this->supervisor['choices'] = $personManager->generate_sales_list();
        #$this->members['choices'] = $personManager->generate_all_list();
        parent::__construct($data);
    }*/
    
    
    public function save(){
        
    }
    
}

